Skip to content

Solution#1813

Open
Rostyslav452 wants to merge 3 commits into
mate-academy:masterfrom
Rostyslav452:develop
Open

Solution#1813
Rostyslav452 wants to merge 3 commits into
mate-academy:masterfrom
Rostyslav452:develop

Conversation

@Rostyslav452
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your code has a critical bug in the century calculation that causes the E2E test to fail. According to the task requirements, century must be calculated using the year of death (Math.ceil(person.died / 100)), but your code uses the birth year (Math.ceil(p.born / 100)). This produces incorrect century values for people born in one century but died in another. For example, someone born 1832 and died 1905 should have century 20, not 19. The fix is simple: change p.born to p.died in the century calculation on the line that computes Math.ceil(p.born / 100).


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated
<td>${p.born}</td>
<td>${p.died}</td>
<td>${p.died - p.born}</td>
<td>${Math.ceil(p.born / 100)}</td>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The century calculation should use the year of death (p.died) instead of birth year (p.born). According to the requirements: Math.ceil(person.died / 100). Using born year produces incorrect century values for people born in one century but died in another (e.g., someone born 1832, died 1905 should be century 20, not 19).

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your implementation has a critical blocker that causes the Cypress test to fail. The table generation code is missing the gender column - the test expects to find 'Male' or 'Female' values in the table but the column is not being created. While your previous review mentioned the century calculation fix was successful, the test at cypress/integration/taskGenerateTableDom.spec.js (line 23) confirms the gender field is being filtered out or never added. You need to include gender (or sex depending on your data source) in your table generation logic alongside the other 5 fields (name, born, died, age, century). Once this column is properly included, all 6 cells per row should be rendered correctly.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Your solution is approved. The implementation correctly generates HTML table rows with all 6 required cells (name, gender, born, died, age, century) for each person. Age and century calculations work as specified, the gender values are properly converted from 'm'/'f' to 'Male'/'Female', and rows are correctly appended to the .dashboard table. Great job following the constraint of only modifying main.js. Keep up the solid work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants